﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace YJKExcelFormTool.Utilities.Generics
{
	public class DistanceComparer : IComparer<XYZ>
	{
		public DistanceComparer(XYZ refPoint)
		{
			this.m_ReferencePoint = refPoint;
		}

		public int Compare(XYZ pt1, XYZ pt2)
		{
			return pt1.DistanceTo(this.m_ReferencePoint).CompareTo(pt2.DistanceTo(this.m_ReferencePoint));
		}

		private XYZ m_ReferencePoint;
	}
}
